package com.mail.manager.modular.service.impl.portal;

import com.mail.manager.modular.mapper.BannerMapper;
import com.mail.manager.modular.model.Banner;
import com.mail.manager.modular.service.portal.IBannerService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * 创建人： Shi Heng
 * 创建时间：2018-03-29 14:21
 * QQ：374696376
 * Description：
 */
@Service
public class BannerServiceImpl implements IBannerService {

    @Resource
    BannerMapper bannerMapper;

    @Override
    public boolean insert(Banner bannerModel) {
        int insert = bannerMapper.insert(bannerModel);
        if(insert>0)
            return true;
        return false;
    }


    @Override
    public boolean delteObject(Integer bannerId) {
        int delete = bannerMapper.deleteByPrimaryKey(bannerId);
        if(delete>0)
            return true;
        return false;
    }

    @Override
    public List<Map<String, Object>> list(String conditiion) {
        return bannerMapper.list(conditiion);
    }

    @Override
    public Banner selectByPrimaryKey(Object id) {
        return bannerMapper.selectByPrimaryKey(id);
    }

    @Override
    public boolean updateObjtById(Banner banner) {
        int update = bannerMapper.updateByPrimaryKey(banner);
        if(update>0)
            return true;
        return false;
    }


}
